package chixing.day06.inherited;

public class CreditAccount extends Account{
    private double overdraftAmount; // 已透支金额
    private double maxOverdraft;// 最大透支额度

    public CreditAccount(){}

    public CreditAccount(double overdraftAmount, double maxOverdraft) {
        this.overdraftAmount = overdraftAmount;
        this.maxOverdraft = maxOverdraft;
    }

    public CreditAccount(String accNo, String accName, String accPersonId, long accTelno, double accBalance, double overdraftAmount, double maxOverdraft) {
        super(accNo, accName, accPersonId, accTelno, accBalance);
        this.overdraftAmount = overdraftAmount;
        this.maxOverdraft = maxOverdraft;
    }

    public double getOverdraftAmount() {
        return overdraftAmount;
    }

    public void setOverdraftAmount(double overdraftAmount) {
        this.overdraftAmount = overdraftAmount;
    }

    public double getMaxOverdraft() {
        return maxOverdraft;
    }

    public void setMaxOverdraft(double maxOverdraft) {
        this.maxOverdraft = maxOverdraft;
    }

    @Override
    public String toString() {
        return "CreditAccount{" +
                "overdraftAmount=" + overdraftAmount +
                ", maxOverdraft=" + maxOverdraft +
                '}';
    }
}
